<template>
  <div id="myResume" class="person-detail">
    <div>
      <van-nav-bar title="我的简历" :fixed="true" left-arrow @click-left="back">
        <span v-show="!isAdd" slot="right" style="color:#fff" @click="change()"
          >编辑</span
        >
      </van-nav-bar>
    </div>
    <div class="myResume-body" v-show="isAdd">
      <div>
        <svg-icon
          icon-class="添加简历"
          widthW="1.3rem"
          heightH="1.3rem"
          @click.native="$router.push({ path: '/work/myResume/addResume' })"
        ></svg-icon>
      </div>
      <div>
        <p>
          添加简历
        </p>
        <p>
          更快找到合适工作
        </p>
      </div>
    </div>
    <div class="myResumeAdd-body" v-show="!isAdd">
      <div>
        <div>
          <div style="display:flex;">
            <div class="myResumeAdd-first">
              <p>{{ resume.username }}</p>
              <p>
                <svg-icon
                  icon-class="我的简历-电话"
                  widthW="0.3rem"
                  heightH="0.3rem"
                ></svg-icon>
                {{ resume.phone }}
              </p>
            </div>
            <div class="myResumeAdd-img">
              <van-image width="60" height="60" :src="resume.headImage" round />
            </div>
          </div>
          <div class="line-myResumeAdd"></div>
          <div class="myResumeAdd-second">
            <p>
              {{
                resume.curStatus == 1
                  ? "在职-考虑机会"
                  : resume.curStatus == 2
                  ? "离职-正在找工作"
                  : ""
              }}
            </p>
            <p>
              {{ resume.age }}岁 |
              {{
                resume.degree == 1
                  ? "博士"
                  : resume.degree == 2
                  ? "硕士"
                  : resume.degree == 3
                  ? "本科"
                  : resume.degree == 4
                  ? "高中"
                  : resume.degree == 5
                  ? "初中"
                  : resume.degree == 6
                  ? "小学"
                  : ""
              }}
              | {{ resume.postName }}
            </p>
            <p>身份证号：{{ resume.idcardNo }}</p>
            <p>户籍所在地：{{ resume.address }}</p>
            <p>详细户籍地址：{{ resume.rregionName }}</p>
            <p>就业地区：{{ resume.eregionName }}</p>
          </div>
        </div>
      </div>
      <div class="myResumeAdd-exprience">
        <p class="myResumeAdd-big">工作经历</p>
        <p>
          <!-- 中电兴发软件研发（北京）有限公司 -->
        </p>
        <p>
          <!-- 2018.05-至今 -->
        </p>
        <p>
          {{ resume.experience }}
        </p>
      </div>
      <div>
        <p class="myResumeAdd-big">自我介绍</p>
        <p class="myResumeAdd-introduce">
          {{ resume.introduction }}
        </p>
      </div>
    </div>
    <van-overlay :show="showoverlay"></van-overlay>
    <van-loading v-show="showoverlay" />
  </div>
</template>
<script>
import mine from "../../../../controller/mine";
export default {
  name: "myResume",
  components: {},
  data() {
    return {
      showoverlay: true,
      isAdd: false,
      resume: ""
    };
  },
  computed: {},
  created() {},
  mounted() {
    this.getInfo();
  },
  methods: {
    change() {
      this.$router.push({ path: "/work/myResume/addResume" }),
        sessionStorage.setItem("resumeInfo", JSON.stringify(this.resume));
    },
    getInfo() {
      let data = JSON.parse(localStorage["userInfo"]).currentUser.id;
      mine.training_resume_get(data).then(res => {
        this.showoverlay = false;
        if (res.code == "0") {
          if (res.datas != null) {
            this.isAdd = false;
            this.resume = res.datas;
          } else {
            this.isAdd = true;
          }
        } else {
          this.$toast(res.msg);
        }
      });
    },
    back() {
      this.$router.go(-1);
    }
  }
};
</script>
<style lang="scss" scoped>
#myResume {
  background: #fff;
  .myResume-add {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
  }
  .myResume-body {
    position: fixed;
    display: flex;
    background: #fff;
    height: 100px;
    border: 1px dotted #e2e2e2;
    border-radius: 10px;
    margin: 10px 20px;
    width: 90%;
    align-items: center;
    > div {
    }
    > div:nth-child(1) {
      text-align: end;
      width: 45%;
    }
    > div:nth-child(2) {
      width: 50%;
      padding-left: 10px;
      > p:nth-child(1) {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 5px;
      }
    }
  }
  .myResumeAdd-body {
    padding: 20px;
  }
  .myResumeAdd-first {
    width: 70%;
    > p:nth-child(1) {
      font-size: 21px;
      font-weight: bold;
    }
    > p:nth-child(2) {
      margin-top: 10px;
      font-weight: 300;
      opacity: 0.7;
    }
  }
  .myResumeAdd-img {
    float: left;
  }
  .myResumeAdd-second {
    font-size: 14px;
    opacity: 0.7;
    > p {
      margin-top: 8px;
    }
    > p:nth-child(1) {
      opacity: 1;
    }
  }
  .myResumeAdd-big {
    font-size: 16px;
    font-weight: 700;
    padding: 20px 0 0 0;
  }
  .line-myResumeAdd {
    width: 98%;
    margin: auto;
    height: 0;
    border: none;
    border-top: 1px solid #e2e2e2;
    margin-top: 10px;
  }
  .myResumeAdd-exprience {
    > p:nth-child(2) {
      font-size: 14px;
      font-weight: 700;
      margin-top: 10px;
    }
    > p:nth-child(3),
    > p:nth-child(4) {
      opacity: 0.7;
    }
  }
  .myResumeAdd-introduce {
    opacity: 0.7;
  }
  .van-loading {
    z-index: 2;
    position: fixed;
    top: 50%;
    left: 46%;
    width: 100%;
    height: 100%;
  }
}
</style>
